// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_SALES_SHIP_ITEM
// * CreateDate    : 2014-06-05 18:30:39
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:39
// * LastChanger   : 2014-06-05 18:30:39
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class SalesShipItemEntity : EntityBase
    {
        public SalesShipItemTable TableSchema
        {
            get
            {
                return SalesShipItemTable.Current;
            }
		}
		
		public SalesShipItemEntity()
        {

        }
		
		public SalesShipItemEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.ShipId = Convert.ToString(CommonFunctions.ToObject(dr["SHIP_ID"]));
			this.ShipNo = Convert.ToString(CommonFunctions.ToObject(dr["SHIP_NO"]));
			this.AppItemId = Convert.ToString(CommonFunctions.ToObject(dr["APP_ITEM_ID"]));
			this.MaterialId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_ID"]));
			this.MaterialName = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_NAME"]));
			this.MaterialCode = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_CODE"]));
			this.Material = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL"]));
			this.ContractModel = Convert.ToString(CommonFunctions.ToObject(dr["CONTRACT_MODEL"]));
			this.DeliveryDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["DELIVERY_DATE"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.ShipedQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["SHIPED_QTY"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
			this.Price = Convert.ToDecimal(CommonFunctions.ToObject(dr["PRICE"]));
			this.TaxRate = Convert.ToDecimal(CommonFunctions.ToObject(dr["TAX_RATE"]));
			this.IsTax = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_TAX"]));
			this.SubTotal = Convert.ToDecimal(CommonFunctions.ToObject(dr["SUB_TOTAL"]));
			this.PackageType = Convert.ToString(CommonFunctions.ToObject(dr["PACKAGE_TYPE"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
        }
		
		public SalesShipItemEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.ShipId = Convert.ToString(CommonFunctions.ToObject(dr["SHIP_ID"]));
			this.ShipNo = Convert.ToString(CommonFunctions.ToObject(dr["SHIP_NO"]));
			this.AppItemId = Convert.ToString(CommonFunctions.ToObject(dr["APP_ITEM_ID"]));
			this.MaterialId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_ID"]));
			this.MaterialName = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_NAME"]));
			this.MaterialCode = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_CODE"]));
			this.Material = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL"]));
			this.ContractModel = Convert.ToString(CommonFunctions.ToObject(dr["CONTRACT_MODEL"]));
			this.DeliveryDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["DELIVERY_DATE"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.ShipedQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["SHIPED_QTY"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
			this.Price = Convert.ToDecimal(CommonFunctions.ToObject(dr["PRICE"]));
			this.TaxRate = Convert.ToDecimal(CommonFunctions.ToObject(dr["TAX_RATE"]));
			this.IsTax = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_TAX"]));
			this.SubTotal = Convert.ToDecimal(CommonFunctions.ToObject(dr["SUB_TOTAL"]));
			this.PackageType = Convert.ToString(CommonFunctions.ToObject(dr["PACKAGE_TYPE"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return SalesShipItemTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(SalesShipItemTable.C_ID)); }
            set { SetData(SalesShipItemTable.C_ID, value); }
        }
		
        [DataMember]
        public string ShipId
        {
            get { return Convert.ToString(GetData(SalesShipItemTable.C_SHIP_ID)); }
            set { SetData(SalesShipItemTable.C_SHIP_ID, value); }
        }
		
        [DataMember]
        public string ShipNo
        {
            get { return Convert.ToString(GetData(SalesShipItemTable.C_SHIP_NO)); }
            set { SetData(SalesShipItemTable.C_SHIP_NO, value); }
        }
		
        [DataMember]
        public string AppItemId
        {
            get { return Convert.ToString(GetData(SalesShipItemTable.C_APP_ITEM_ID)); }
            set { SetData(SalesShipItemTable.C_APP_ITEM_ID, value); }
        }
		
        [DataMember]
        public string MaterialId
        {
            get { return Convert.ToString(GetData(SalesShipItemTable.C_MATERIAL_ID)); }
            set { SetData(SalesShipItemTable.C_MATERIAL_ID, value); }
        }
		
        [DataMember]
        public string MaterialName
        {
            get { return Convert.ToString(GetData(SalesShipItemTable.C_MATERIAL_NAME)); }
            set { SetData(SalesShipItemTable.C_MATERIAL_NAME, value); }
        }
		
        [DataMember]
        public string MaterialCode
        {
            get { return Convert.ToString(GetData(SalesShipItemTable.C_MATERIAL_CODE)); }
            set { SetData(SalesShipItemTable.C_MATERIAL_CODE, value); }
        }
		
        [DataMember]
        public string Material
        {
            get { return Convert.ToString(GetData(SalesShipItemTable.C_MATERIAL)); }
            set { SetData(SalesShipItemTable.C_MATERIAL, value); }
        }
		
        [DataMember]
        public string ContractModel
        {
            get { return Convert.ToString(GetData(SalesShipItemTable.C_CONTRACT_MODEL)); }
            set { SetData(SalesShipItemTable.C_CONTRACT_MODEL, value); }
        }
		
        [DataMember]
        public DateTime DeliveryDate
        {
            get { return Convert.ToDateTime(GetData(SalesShipItemTable.C_DELIVERY_DATE)); }
            set { SetData(SalesShipItemTable.C_DELIVERY_DATE, value); }
        }
		
        [DataMember]
        public decimal Qty
        {
            get { return Convert.ToDecimal(GetData(SalesShipItemTable.C_QTY)); }
            set { SetData(SalesShipItemTable.C_QTY, value); }
        }
		
        [DataMember]
        public decimal ShipedQty
        {
            get { return Convert.ToDecimal(GetData(SalesShipItemTable.C_SHIPED_QTY)); }
            set { SetData(SalesShipItemTable.C_SHIPED_QTY, value); }
        }
		
        [DataMember]
        public string Unit
        {
            get { return Convert.ToString(GetData(SalesShipItemTable.C_UNIT)); }
            set { SetData(SalesShipItemTable.C_UNIT, value); }
        }
		
        [DataMember]
        public decimal Price
        {
            get { return Convert.ToDecimal(GetData(SalesShipItemTable.C_PRICE)); }
            set { SetData(SalesShipItemTable.C_PRICE, value); }
        }
		
        [DataMember]
        public decimal TaxRate
        {
            get { return Convert.ToDecimal(GetData(SalesShipItemTable.C_TAX_RATE)); }
            set { SetData(SalesShipItemTable.C_TAX_RATE, value); }
        }
		
        [DataMember]
        public int IsTax
        {
            get { return Convert.ToInt32(GetData(SalesShipItemTable.C_IS_TAX)); }
            set { SetData(SalesShipItemTable.C_IS_TAX, value); }
        }
		
        [DataMember]
        public decimal SubTotal
        {
            get { return Convert.ToDecimal(GetData(SalesShipItemTable.C_SUB_TOTAL)); }
            set { SetData(SalesShipItemTable.C_SUB_TOTAL, value); }
        }
		
        [DataMember]
        public string PackageType
        {
            get { return Convert.ToString(GetData(SalesShipItemTable.C_PACKAGE_TYPE)); }
            set { SetData(SalesShipItemTable.C_PACKAGE_TYPE, value); }
        }
		
        [DataMember]
        public string Remark
        {
            get { return Convert.ToString(GetData(SalesShipItemTable.C_REMARK)); }
            set { SetData(SalesShipItemTable.C_REMARK, value); }
        }
		
		#endregion
	}
	
	
}	

